﻿namespace CRM.Business.Services
{
    using System.Collections.Generic;
    using CRM.DataAccess.DAOs;
    using CRM.DataAccess.Entities;

    public static class RoleService
    {
        /// Gets or sets the role DAO.
        private static RoleDAO RoleDAO = new RoleDAO();

        //Get Role
        public static List<ROLE> GetRoles()
        {
            return RoleDAO.GetRoles();
        }
        //Get Role by ID
        public static ROLE GetRoleByID(long id)
        {
            return RoleDAO.GetRoleByID(id);
        }
        //delete role
        public static int DeleteRole(long id)
        {
            return RoleDAO.DeleteRole(id);
        }
        //update Role
        public static int UpdateRole(ROLE role)
        {
            return RoleDAO.UpdateRole(role);
        }
        // get Role by condition
        public static List<ROLE> GetRoleByCondition(string RoleName, bool? isActive, bool? isManager)
        {
            return RoleDAO.GetRoleByCondition(RoleName, isActive, isManager);
        }
        // add new Role
        public static int AddNewRole(ROLE role)
        {
            return RoleDAO.AddNewRole(role);
        }
        //Check exist
        public static int CheckExist(string RoleName)
        {
            return RoleDAO.CheckExist(RoleName);
        }
    }
}
